package edu.rmit.domain;

import java.io.Serializable;

/**
 * This class represend the participant user in this system. It is have two
 * roles, one is the normal user, another is the administrator.
 * 
 * @author Thaw Zin
 * @version 1.0
 */
@SuppressWarnings("serial")
public class User implements Serializable {

	/**
	 * ID of the user in database
	 */
	private int id;

	/**
	 * username of the user for login to the system
	 */
	private String userName;

	/**
	 * password of the user for login to the system
	 */
	private String passWord;

	/**
	 * First name of the user
	 */
	private String firstName;

	/**
	 * Last name of the user
	 */
	private String lastName;

	/**
	 * The user's role type, 1 for administrator, 2 for registered user.
	 */
	private int roleType;

	/**
	 * The user is suspended or not.
	 */
	private boolean isActive;
	
	private boolean islogin;

	/**
	 * The constructor without parameter.
	 */
	public User() {
	}

	/**
	 * This is the construtor of the User object.
	 * 
	 * @param firstName
	 *            The first name of the user.
	 * @param lastName
	 *            The last name of the user.
	 * @param passWord
	 *            The password of the user.
	 * @param roleType
	 *            The role type of the user.
	 * @param userName
	 *            The user name of the user.
	 * @param isActive
	 *            The current state of the user.
	 */
	public User(String firstName, String lastName, String passWord,
			int roleType, String userName, boolean isActive) {
		this.firstName = firstName;
		this.lastName = lastName;
		this.passWord = passWord;
		this.roleType = roleType;
		this.userName = userName;
		this.isActive = isActive;
	}

	/**
	 * Get the user id of the user.
	 * 
	 * @return The user id.
	 */
	public int getId() {
		return id;
	}

	/**
	 * Set the user id.
	 * 
	 * @param id
	 *            The user id which you want to be setted.
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * Get the user name of the user.
	 * 
	 * @return The user's username.
	 */
	public String getUserName() {
		return userName;
	}

	/**
	 * Set the username of the user.
	 * 
	 * @param userName
	 *            The username you want to be setted.
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}

	/**
	 * Get the password of the user.
	 * 
	 * @return The password of the current user.
	 */
	public String getPassWord() {
		return passWord;
	}

	/**
	 * Set the current user's password.
	 * 
	 * @param passWord
	 *            The password you want to be setted.
	 */
	public void setPassWord(String passWord) {
		this.passWord = passWord;
	}

	/**
	 * Get the first name of the current user.
	 * 
	 * @return The first name of the current user.
	 */
	public String getFirstName() {
		return firstName;
	}

	/**
	 * Set the firstname of the current user.
	 * 
	 * @param firstName
	 *            The first name which you wan to be set for the current user.
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/**
	 * Get the last name of the current user.
	 * 
	 * @return The last name of the current user.
	 */
	public String getLastName() {
		return lastName;
	}

	/**
	 * Set the last name of the current user.
	 * 
	 * @param firstName
	 *            The last name which you wan to be set for the current user.
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	/**
	 * Get the role type of the current user.
	 * @return The role type of the current user.
	 */
	public int getRoleType() {
		return roleType;
	}

	/**
	 * Set the role type of the current user.
	 * 
	 * @param firstName
	 *            The role type which you wan to be set for the current user.
	 */
	public void setRoleType(int roleType) {
		this.roleType = roleType;
	}

	/**
	 * Get the status of the current user.
	 * @return The status of the current user.
	 */
	public boolean IsActive() {
		return isActive;
	}

	/**
	 * Set the status of the current user.
	 * @param isActive The status of the current user.
	 */
	public void setActive(boolean isActive) {
		this.isActive = isActive;
	}

	public boolean isIslogin() {
		return islogin;
	}

	public void setIslogin(boolean islogin) {
		this.islogin = islogin;
	}
}
